#ifndef __MAGICTOWER_H__
#define __MAGICTOWER_H__
#define true 1
#define false 0
#include"MyString.h"
#include"DynamicArray.h"
#include"LoginSignup.h"
#include"StdFile.h"
#define Map_Size 10
typedef struct Player
{
    int HP;
    int attack;
    //金币数量
    int now_money;
    //防御
    int defense;
    //宝藏数量
    int count_treasures;
    //血瓶数量
    int count_add_blood;
    //霸体数量
    int count_add_defense;
    //是否拥有眩晕技能
    int Dizzy;
    //眩晕数量，使用可以让怪物无法进行攻击
    int count_monsters_Dizzy;
    int x;
    int y;
}P;

typedef struct Monster
{
    MyString name;
    int HP;
    int attack;
    //打败怪物获得的金币
    int kill_money;
    int x;
    int y;
}M;

typedef struct Treasure
{
    MyString name;
    int value;
    int x;
    int y;
    int flag;
}T;
//初始化玩家
extern void InitPlayer(P* player);
//设置随机数
extern int GetRandNumber(int max);
//创建怪兽，返回怪兽的指针
extern M* CreateMonster(const char* name, int HP, int attack, int kill_money);
//创建宝物，返回宝物的指针
extern T* CreateTreasure(const char* name, int value);
//初始化怪兽，并存入到动态数组中，动态数组中存放的是怪兽的指针
extern void InitMonsters(DmArr* array);
//初始化宝物，并存入到动态数组中，动态数组中存放的是宝物的指针
extern void InitTreasure(DmArr* array);
//键盘操作人物移动，商店操作，背包操作
extern void MakeMove(P* player, char symbol);
//战斗实现
extern int Battle(P* player, M* monster,DmArr *MonsterArr);
////初始化地图
extern int InitBoard(char(*p)[Map_Size],DmArr *monsters);
//打印地图
extern void PrintMap(char(*p)[Map_Size], P* player,DmArr *monsters);
//玩法实现
extern void Game(DmArr *treasures,DmArr *monsters,struct Player *player,char board[Map_Size][Map_Size],char *userID,char(*p)[Map_Size]);
//将游戏进度按照格式化输入的形式存入到文档中
void SaveGameProcess(DmArr *treasures,DmArr *monsters,struct Player *player,const char *FilePath);
//保存游戏的进度
void LoadGameProcess(DmArr *monster, DmArr *treasure,struct Player *player,const char *FilePath,DBL *monsterlist);
#endif